// 数字枚举
var Color;
(function (Color) {
    Color[Color["RED"] = 0] = "RED";
    Color[Color["GREEN"] = 1] = "GREEN";
    Color[Color["YELLOW"] = 2] = "YELLOW";
})(Color || (Color = {}));
console.log(Color.RED); // 0
console.log(Color.GREEN); // 1
console.log(Color.YELLOW); // 2
console.log(Color[0]); // 'RED'
console.log(Color[1]); // 'GREEN'
console.log(Color[2]); // 'YELLOW'
// 数字枚举加默认赋值
var HttpResult;
(function (HttpResult) {
    HttpResult[HttpResult["GET"] = 3] = "GET";
    HttpResult[HttpResult["POST"] = 2] = "POST";
    HttpResult[HttpResult["PUT"] = 5] = "PUT";
    HttpResult[HttpResult["PATCH"] = 6] = "PATCH";
})(HttpResult || (HttpResult = {}));
// 字符串枚举
var HttpMethod;
(function (HttpMethod) {
    HttpMethod["GET"] = "1";
    HttpMethod["POST"] = "2";
    HttpMethod["PUT"] = "3";
    HttpMethod["PATCH"] = "4";
})(HttpMethod || (HttpMethod = {}));
console.log(0 /* Role.ADMIN */); // 0
console.log(1 /* Role.EDIT */); // 1
